<template>
  <div class="container">
    <div class="navBox">
      <router-link v-for="item in sideNav" :to="{name: item.name}" v-if="item.showType === 1" :key="item.id" @click.native="choosView">
        <i class="iconfont" v-html="item.nameIcon"></i>{{item.meta.title}}
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: 'mainAside',
  data () {
    return {
      infoRoute: null,
      sideNav: this.$store.state.sideNav,
      icon: '&#xe62f'
    }
  },
  watch: {
    '$store.state.sideNav' (val) {
      this.sideNav = val
    }
  },
  mounted () {
    // this.navSide()
    console.log(JSON.parse(window.sessionStorage.getItem('permission')))
  },
  methods: {
    choosView () {
      this.$store.commit('isShowFn', true)
      this.$store.commit('isDetailFn', false)
      this.$store.commit('addVisibelFn', false)
    }
  }
}
</script>

<style scoped lang="less">
  .container{
    .navBox{
      a{
        margin-top:20px;
        color:#fff;
        width:100%;
        line-height:50px;
        font-size:18px;
        text-align: left;

        .iconfont{
          margin: 0 30px 0 80px ;
        }
      }
      .nav-active{
        background: #1f2327;
      }
    }
  }
</style>
